ci: support semver breaking changes#6963
Conversation
📝 WalkthroughWalkthroughThe GitHub release script is updated to recognize breaking changes in conventional commits marked with trailing exclamation marks (e.g., Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 6959a29
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/create-github-release.mjs (1)
163-179:⚠️ Potential issue | 🔴 CriticalBreaking markers still get filtered out before grouping.
breaking: ...commits parse astype === 'breaking', andchore!: .../ci!: ...commits parse as breaking, but both are dropped by the user-facing type check before they can reach the newbreakingbucket. That means the release can still miss the exact breaking markers this PR is meant to surface.Suggested fix
const conventionalMatch = subject.match(/^(\w+)(?:\(([^)]*)\))?(!)?:\s*(.*)$/) const type = conventionalMatch ? conventionalMatch[1] : 'other' - const isBreaking = conventionalMatch ? !!conventionalMatch[3] : false + const isBreaking = conventionalMatch + ? type === 'breaking' || !!conventionalMatch[3] + : false const scope = conventionalMatch ? conventionalMatch[2] || '' : '' const message = conventionalMatch ? conventionalMatch[4] : subject // Only include user-facing change types - if (!['feat', 'fix', 'perf', 'refactor', 'build'].includes(type)) continue + if ( + !isBreaking && + !['feat', 'fix', 'perf', 'refactor', 'build'].includes(type) + ) { + continue + } // Extract PR number if present const prMatch = message.match(/\(#(\d+)\)/) const prNumber = prMatch ? prMatch[1] : null const bucket = isBreaking ? 'breaking' : type🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/create-github-release.mjs` around lines 163 - 179, The current filter discards commits before grouping because it only allows types in ['feat','fix','perf','refactor','build'], so commits parsed as breaking (type==='breaking') or commits with a '!' (isBreaking true) never reach the "breaking" bucket; update the filter logic around conventionalMatch/type/isBreaking so that you only continue (skip) when the commit is neither one of the allowed user-facing types nor a breaking marker — e.g., change the check that uses type and isBreaking to allow commits where isBreaking is true or type === 'breaking' in addition to the existing allowed list — then keep the existing bucket assignment (const bucket = isBreaking ? 'breaking' : type) and push into groups[bucket] as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@scripts/create-github-release.mjs`:
- Around line 163-179: The current filter discards commits before grouping
because it only allows types in ['feat','fix','perf','refactor','build'], so
commits parsed as breaking (type==='breaking') or commits with a '!' (isBreaking
true) never reach the "breaking" bucket; update the filter logic around
conventionalMatch/type/isBreaking so that you only continue (skip) when the
commit is neither one of the allowed user-facing types nor a breaking marker —
e.g., change the check that uses type and isBreaking to allow commits where
isBreaking is true or type === 'breaking' in addition to the existing allowed
list — then keep the existing bucket assignment (const bucket = isBreaking ?
'breaking' : type) and push into groups[bucket] as before.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 94e8d7c2-1a69-4c77-8c2e-08b6bf8d4b0a
📒 Files selected for processing (1)
scripts/create-github-release.mjs
This pr will make a proper "Breaking Changes" section if there are any. A breaking change is marked by exlcamation mark, like
feat!:Summary by CodeRabbit